﻿#pragma once

#include <QWidget>
#include "ui_SDLRenderYUVWindow.h"
#include "../../common/utils/BinaryFileReader.h"
#include <thread>
#include <QCloseEvent>

class SDLRenderYUVWindow : public QWidget
{
	Q_OBJECT

public:
	SDLRenderYUVWindow(QWidget *parent = nullptr);
	~SDLRenderYUVWindow();
	void RenderVideo();
protected:
	// 重写关闭事件处理函数
	void closeEvent(QCloseEvent* event) override;
public slots:
	void choiceYUV420PFile();

private:
	Ui::SDLRenderYUVWindow ui;
	std::unique_ptr<std::thread> renderThread;
	int mWidth = 0;
	int mHeight = 0;
	bool isRunning = true;
	BinaryFileReader *binaryFileReader = nullptr;
};
